part of '../repository.dart';

class _WebTransactionHistoryGettingSuccessfulResponseDto {
  const _WebTransactionHistoryGettingSuccessfulResponseDto._internal({
    required this.transactionHistoryItemDtos,
  });

  final BuiltList<_WebTransactionHistoryItemDto> transactionHistoryItemDtos;

  factory _WebTransactionHistoryGettingSuccessfulResponseDto.fromJson(Map<String, dynamic> json) {
    final transactionHistoryItemMaps = List.castFrom<dynamic, Map>(json['web_transaction_history']);

    final transactionHistoryItemDtos = transactionHistoryItemMaps.map((paymentMethodMap) {
      final transactionHistoryItemJson =
          Map.castFrom<dynamic, dynamic, String, dynamic>(paymentMethodMap);
      final transactionHistoryItemDto =
          _WebTransactionHistoryItemDto.fromJson(transactionHistoryItemJson);
      return transactionHistoryItemDto;
    }).toBuiltList();

    return _WebTransactionHistoryGettingSuccessfulResponseDto._internal(
      transactionHistoryItemDtos: transactionHistoryItemDtos,
    );
  }
}
